#include "stdafx.h"
#include "CReferenceCountBase.h"




CReferenceCountBase::CReferenceCountBase()
{
	this->m_cReferences = 1;

	*((DWORD *)&this->m_magic + 0) = 'cfer';
	*((DWORD *)&this->m_magic + 2) = 'tnuo';

	this->m_magic = (long long)"tnuocfer";
}

CReferenceCountBase::~CReferenceCountBase()
{

	if ( *((DWORD *)&this->m_magic + 0) != 'cfer' || *((DWORD *)&this->m_magic + 2) != 'tnuo' )
	{

	}
	if ( this->m_cReferences )
	{

	}

	*((DWORD *)&this->m_magic + 0) = 'tsed';
	*((DWORD *)&this->m_magic + 2) = 'dyor';
}

void CReferenceCountBase::AddRefPreCheck()
{
	if ( *((DWORD *)&this->m_magic + 0) != 'cfer' || *((DWORD *)&this->m_magic + 2) != 'tnuo' )
	{

	}
	if ( !this->m_cReferences )
	{

	}
	if ( this->m_cReferences >= 0xFFFFFF )
	{

	}
}

void CReferenceCountBase::AddRefPostCheck( XUINT32 cReferences )
{

	if ( (cReferences & 0x80000000u) != 0 )
	{

	}
	if ( (signed int)cReferences >= (signed int)0xFFFFFFu )
	{

	}
}

void CReferenceCountBase::ReleasePreCheck()
{

	if ( *((DWORD *)&this->m_magic + 0) != 'cfer' || *((DWORD *)&this->m_magic + 2) != 'tnuo' )
	{

	}
	if ( !this->m_cReferences )
	{

	}
	if ( this->m_cReferences >= 0xFFFFFF )
	{

	}
}

void CReferenceCountBase::ReleasePostCheck( XUINT32 cReferences )
{
	if ( (cReferences & 0x80000000u) != 0 )
	{

	}
}

CReferenceCountBase & CReferenceCountBase::operator=( const CReferenceCountBase  & rhs )
{
	this->m_cReferences = rhs.m_cReferences;
	*((DWORD *)&this->m_magic + 0) = *((DWORD *)&rhs.m_magic + 0);
	*((DWORD *)&this->m_magic + 2) = *((DWORD *)&rhs.m_magic + 2);
	return *this;
}
